import {createRouter, createWebHashHistory} from "vue-router";
import Redirect from "./modules/redirect";
import Error from "./modules/error";
import Home from "./modules/home";
import Common from "./modules/common";
import User from "./modules/user";
const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        ...Redirect,
        ...Error,
        ...Home,
        ...Common,
        ...User
    ],
    scrollBehavior(to, from, savedPosition){
        if (savedPosition) {
            return savedPosition
        } else {
            return { left: 0, top: 0 }
        }
    }
})
export default router